package com.example.test.advice.第六章_枚举和注解.建议87_使用valueOf前必须进行校验;

public enum Season {
    Spring,Summer,Autumn,Winter;

    public static Season getComfortableSeason(){

        return Spring;
    }

    public Season getBetterSeason(){

        return Spring;
    }

    public static boolean contains(String name){
        for(Season season:Season.values()){
            if(season.name().equals(name)){
                return true;
            }
        }

        return false;
    }
}
